package cn.itcast.demo.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author 虎哥
 */
@Slf4j
//@Component
public class HelloTask {

//    @Scheduled(cron = "0/2 * * * * ?")
    @Scheduled(fixedRate = 2000)
//    @Scheduled(fixedDelay = 2000)
    public void job() throws InterruptedException {
        Thread.sleep(1000);
        log.info("定时任务正在执行！");
    }
}
